import axios from 'axios';

class Service {

    static listDishSpecs(baseQuery, callback) {
        return axios.post("/manage-api/list-specs", baseQuery).then((data) => {
            callback ? callback(data) : null;
        })
    }

    static addDishSpec(dishSpec, callback) {
        return axios.post("/manage-api/dishSpec", dishSpec).then((data) => {
            callback ? callback(data) : null;
        })
    }

    static removeDishSpecs(id, callback) {
        return axios.delete("/manage-api/dishSpec/" + id).then((data) => {
            callback ? callback(data) : null;
        })
    }

    static updateDishSpecs(dishSpec, callback) {
        return axios.put("/manage-api/dishSpec", dishSpec).then((data) => {
            callback ? callback(data) : null;
        })
    }

    static getDishSpecs(id, callback) {
        return axios.get("/manage-api/dishSpec/" + id).then((data) => {
            callback ? callback(data) : null;
        })
    }
}

export default Service;